Skip to main content

Create Order v2

Create an asynchronous order which will be placed in a queue and processed later.

Order Creation v2

Orders can be placed by a POST request to v2/order API endpoint. Each request to create an order must include, alongwith the necessary authentication headers, order information in the request body. The format for the same can be found in the Create Order API Reference.

  • Acquire the create-order-payload from Account Manager.
  • Configure the order details in the create-order-payload json. This payload will be placed in the request body.
  • Acquire access-token as mentioned in Authentication. The account's clientId and secret can be found in WebApp
  • Make a POST request to /order API endpoint. API reference in Create Order V2
danger

For orders placed with country=USA, the region field must be included in Shipping address.

Creating a test order

To make sure the account and webhook have been successfully registered, we suggest to send few test orders before going live. The steps to create a test order are the same as a real one mentioned above. In case of a test order, the fakeOrder key in the payload will have true value.

warning

The fakeOrder flag, which is a part of the create-order-payload, has to be set as true (otherwise the order placed will be produced) .

Difference between v1 and v2 Version

There are two endpoints to place orders which accept the same payload as mentioned above, but differ in the way they process the request and response:

  • v1/order version which processes the request immediately.
  • v2/order version where the order is placed in a queue on a fire-and-forget basis, the request is processed as per the queue without any added delay.
Featurev1v2
Request ProcessingSynchronous (Immediate response)Asynchronous (Placed in a queue for processing)
ResponseReturns the created order with pricing and promised arrival date"Your order has been successfully placed for processing"
Order Creation TimingInstant, immediately processedOrder is processed in a queue
Use CaseSuitable for immediate order processing when the order details are required on prioritySuitable for high-volume or queued order processing